Skip to content

Conversation

ItsMilos
Copy link
Contributor

Transforms ISIL into higher level with stack analysis, ssa form, simplification, etc. and then translates that into CIL.
The decompiled C# is pretty messy right now (dnSpy just refuses to decompile it, but ILSpy works) but most of the times it's possible to at least see what methods do.

I'm MrUser127 btw, i changed my name, and that stuff in that previous decompiler pr should now be fixed, and now i actually have motivation to work on this if something needs to be changed

@coveralls
Copy link

coveralls commented Aug 20, 2025

Pull Request Test Coverage Report for Build 17216182984

Details

  • 100 of 1839 (5.44%) changed or added relevant lines in 29 files are covered.
  • 41 unchanged lines in 6 files lost coverage.
  • Overall coverage decreased (-4.0%) to 30.38%

Changes Missing Coverage Covered Lines Changed/Added Lines %
Cpp2IL.Core/ISIL/StackOffset.cs 1 2 50.0%
Cpp2IL.Core/InstructionSets/Arm64InstructionSet.cs 0 1 0.0%
Cpp2IL.Core/InstructionSets/ArmV7InstructionSet.cs 0 1 0.0%
Cpp2IL.Core/InstructionSets/WasmInstructionSet.cs 0 1 0.0%
Cpp2IL.Core/DecompilerException.cs 0 3 0.0%
Cpp2IL.Core/OutputFormats/AsmResolverDllOutputFormat.cs 0 3 0.0%
Cpp2IL.Core/ProcessingLayers/CallAnalysisProcessingLayer.cs 0 4 0.0%
Cpp2IL.Core/ISIL/FieldReference.cs 0 5 0.0%
Cpp2IL.Core/ISIL/LocalVariable.cs 0 5 0.0%
Cpp2IL.Core/ProcessingLayers/NativeMethodDetectionProcessingLayer.cs 0 5 0.0%
Files with Coverage Reduction New Missed Lines %
Cpp2IL.Core/Graphs/ISILControlFlowGraph.cs 1 38.29%
Cpp2IL.Core/Extensions/MiscExtensions.cs 2 5.23%
Cpp2IL.Core/Model/Contexts/MethodAnalysisContext.cs 2 54.87%
Cpp2IL.Core/OutputFormats/AsmResolverDllOutputFormatIlRecovery.cs 3 0.79%
Cpp2IL.Core/InstructionSets/NewArmV8InstructionSet.cs 12 0.0%
Cpp2IL.Core/InstructionSets/X86InstructionSet.cs 21 0.13%
Totals Coverage Status
Change from base Build 16882556085: -4.0%
Covered Lines: 4093
Relevant Lines: 11850

💛 - Coveralls

@ds5678 ds5678 mentioned this pull request Aug 21, 2025
@SamboyCoding
Copy link
Owner

SamboyCoding commented Aug 24, 2025

So I attempted to review this but I think you have a massive number of thread safety issues. I got thousands of exceptions - some concurrent modification, some sequence contained no matching element, and various others - while analyzing, and then when it finished and tried to write the assemblies, I got an AggregateException with 2588 inner exceptions, most of which were either MemberNotImportedException, or IL_[offset] references an offset that is not present in the method body.

From a quick look, you're using one _ilGenerator in AsmResolverDllOutputFormatIlRecovery.FillMethodBody, but that method is called in parallel so you've got multiple calls to it at once, which it can't handle - e.g. it maintains an _importer field which is being overwritten constantly, so methods are being imported into the wrong modules. Seems you'll have to pass that through.

The control flow graphs I did get (I uncommented the line which wrote them, so that I could evaluate the decompilation in at least some way) looked promising, though they were much more complex and I didn't have much time to familiarise myself with the string representations you were using.

For reference, I was attempting to decompile AUDICA.

@ItsMilos
Copy link
Contributor Author

I forgot to try this in non debug mode so stuff was not actually parallel, should be fixed now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants